Don't read over the end of the buffer if '#' appears at the very end.
authorMatthias Clasen <mclasen@redhat.com>
Wed, 16 Feb 2005 03:38:22 +0000 (03:38 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Wed, 16 Feb 2005 03:38:22 +0000 (03:38 +0000)
2005-02-15  Matthias Clasen  <mclasen@redhat.com>

* io-pnm.c (pnm_skip_whitespace): Don't read over the end of
the buffer if '#' appears at the very end.  (#167141, Doug Morgan)

gdk-pixbuf/ChangeLog
gdk-pixbuf/io-pnm.c

index da93aa4adedba32369e4135a2cc7f5c0234c612f..1df3d50869fef3562f03a3c630f6bb39d2e89b81 100644 (file)
@@ -1,3 +1,8 @@
+2005-02-15  Matthias Clasen  <mclasen@redhat.com>
+
+       * io-pnm.c (pnm_skip_whitespace): Don't read over the end of
+       the buffer if '#' appears at the very end.  (#167141, Doug Morgan)
+
 2005-02-05  Hans Breuer  <hans@breuer.org>
 
        * makefile.msc : rule for gdk_pixbuf.def
index 2ac6d2972313aa319a004299a11d615796c605dc..b568b4bccc357efff5c8062764f3dfdce1e100fd 100644 (file)
@@ -192,7 +192,7 @@ pnm_skip_whitespace (PnmIOBuffer *inbuf, GError **error)
                        for ( ; *inptr != '\n' && inptr < inend; inptr++)
                                ;
                        
-                       if ( *inptr != '\n' ) {
+                       if ( inptr == inend || *inptr != '\n' ) {
                                /* couldn't read whole comment */
                                return PNM_SUSPEND;
                        }